import React, {Component} from 'react';
import {Counter,Label} from 'iftide';

import {View,Text} from 'react-native';

export default class Basic extends Component{
    constructor(props) {
        super(props);
        this.state = {
            isReciprocal:false,//是否是倒数
            initVal:0,
            endVal:60,
            stepVal:3,
            time:200,
            counterStyle:{fontSize:20, color:'blue'},
            width:40
        };
    }

    _startEvent=()=>{
        console.log("开始计数")
    }

    _endEvent=()=>{
        console.log("结束计数")
    }


    render(){
        let obj={
            isReciprocal:true,
            initVal:1000,
            endVal:0,
            stepVal:20,
            time:100,
            startEvent:this._startEvent,
            endEvent:this._endEvent
        }
        return(
            <View style={{flex:1}}>
                <View style={{flexDirection:'row',alignItems:'center'}}>
                    <Label text = '正数计数：' type={'secTitle'}  color={'disable'}/>
                    <Text>已向您的手机发送验证码，</Text>
                    <Counter {...this.state}/>
                    <Text>s后将重新发送</Text>
                </View>
                <View style={{flexDirection:'row',alignItems:'center'}}>
                    <Label text = '倒数计数：' type={'secTitle'}  color={'disable'}/>
                    <Counter {...obj}/>
                </View>
            </View>

        );
    }
}